import { get,post, postStringify,_delete } from './httpAxios'
//let base = 'http://4g041113r4.zicp.vip';
let base = 'http://localhost:45397';
// 如果是IIS部署，用这个，因为 IIS 只能是 CORS 跨域，不能代理
// let base = process.env.NODE_ENV=="production"? 'http://localhost:8081':'';
// 登录
export const requestLogin = params => get(`${base}/ManageApi/Login/ManageLogin`,params)
export const requestLoginMock = params => post(`${base}/login`, params);
export const refreshToken = params => get(`${base}/ManageApi/RefreshToken`,params);
export const getUserByToken = params => get(`${base}/ManageApi/User/GetUserInfo`,params)
//静态数据,获取试卷类型枚举
export const staticPaperEnumList=params => get(`../static/source/PaperEnumList.json`);
//获取试题类型枚举
export const staticQuestionTypeEnum = params => get(`../static/source/QuestionTypeEnum.json`);
// 用户管理
export const getUserListPage = params =>get(`${base}/ManageApi/User/GetUserList`, params);
export const saveUser = params => post(`${base}/ManageApi/User/saveUser`, params);
export const removeUser = params => _delete(`${base}/ManageApi/User/RemoveUser`,params);
// 角色管理
export const getRoleListPage = params => get(`${base}/ManageApi/Role/GetRoleList`,params);
export const GetRoleListEnabled = params => get(`${base}/ManageApi/Role/GetRoleListEnabled`,params);
export const saveRole = params => post(`${base}/ManageApi/Role/SaveRole`, params);
export const removeRole = params => post(`${base}/ManageApi/Role/RemoveRole`, params);
export const getMenuByRole = params => get(`${base}/ManageApi/role/GetMenuByRole`, params);
//保存角色菜单权限
export const SaveMenuRole = params => post(`${base}/ManageApi/Role/SaveMenuRole`, params);
// 接口模块管理
export const getApiListPage = params => get(`${base}/ManageApi/ApiMgr/GetApiList`, params);
export const GetApiListEnabled = params => get(`${base}/ManageApi/ApiMgr/GetApiListEnabled`, params);
export const removeApi = params => post(`${base}/ManageApi/ApiMgr/DeleteApi`, params);
export const saveApi = params => post(`${base}/ManageApi/ApiMgr/SaveApi`, params);
// 菜单模块管理
export const getMenulist = params => get(`${base}/ManageApi/Menu/GetMenuList`, params);
export const removeMenu = params => post(`${base}/ManageApi/Menu/removeMenu`, params);
export const saveMenu = params => post(`${base}/ManageApi/Menu/Savemenus`, params);
export const getMenuChild = params => get(`${base}/ManageApi/Menu/GetMenuChild`, params);
export const getMenuTree = params => get(`${base}/ManageApi/Menu/GetMenuTree`, params);
export const getAllMenuTree = params => get(`${base}/ManageApi/Menu/AllMenuTree`, params);
export const getNavigationBar = params => get(`${base}/ManageApi/User/GetNavigationBar`, params)
//考试分类管理
export const getCategoryList = params => get(`${base}/ManageApi/Category/List`, params)
export const saveCategory = params =>post(`${base}/ManageApi/Category/SaveCateGory`, params);
export const removeCategory = params => post(`${base}/ManageApi/Category/Delete`, params);
//章节管理
export const getChapterList = params => get(`${base}/ManageApi/Chapter/List`, params);
export const saveChapter = params => post(`${base}/ManageApi/Chapter/SaveChapter`, params);
export const removeChapter = params => post(`${base}/ManageApi/Chapter/Delete`, params);
//按钮方法管理
export const getFunctionList = params => get(`${base}/ManageApi/Function/GetFuncionList`, params);
export const getFunctionAll = params => get(`${base}/ManageApi/Function/GetAllFuncionList`, params)
export const saveFunction = params => post(`${base}/ManageApi/Function/SaveFunction`, params);
export const removeFunction = params => post(`${base}/ManageApi/Function/RemoveFunction`, params);
//试卷管理
export const getPaperList = params => post(`${base}/ManageApi/Paper/List`,params);
//题型管理
export const getQuestionTypeList = params => post(`${base}/ManageApi/QuestionType/List`,params)
export const saveQuestionType = params => post(`${base}/ManageApi/QuestionType/SaveQuestionType`, params);
export const removeQuestionType = params => post(`${base}/ManageApi/QuestionType/RemoveQuestionType`, params);